# GET https://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify&r=0.42531334581629276 HTTP/1.1
import requests

from config import PATH

session1=requests.session()
res1=session1.get(url="http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=verify&r=0.9725052204091806")
# print(res1.cookies)
print(res1)
with open(f"{PATH}/img/img.png", "wb") as file:
    file.write(res1.content)
data1={
    "username": "17388038301",
    "password": "qq239206",
    "verify_code": "8888"
}
res2=session1.post(url="http://hmshop-test.itheima.net/index.php?m=Home&c=User&a=do_login&t=0.663956357664635"
                  ,data=data1
                    ,cookies=res1.cookies
                   )
# print(res2.cookies)
print(res2.json())
res3=session1.get(url="http://hmshop-test.itheima.net/index.php/Home/Order/order_list.html"
                  ,cookies=res1.cookies)
print(res3.text)